/**
 * @author LKQ
 * @date 2021/12/25 15:56
 * @description 递归
 */
public class Solution2 {
    public static void main(String[] args) {
        Solution2 solution = new Solution2();
        solution.isPowerOfThree(27);
    }

    public boolean isPowerOfThree(int n) {
        if (n==1) {
            return true;
        }
        return isPowerOfThree(n / 3);
    }
}
